import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Before;
import org.junit.Test;


public class Testing {

	public Prison prison= new Prison(10, 10);
	public int x, y;
	public Player player;
	public Weapon spada = new Weapon("spada", 30);
	
	@Before
	public void first(){
		prison.creaStanza();
		player = new Player();
	}
	
	@Test
	public void testMove(){
		x = 1;
		y = 2;
		assertTrue(player.moveUp(x, y));
		x = 6;
		y = 5;
		assertTrue(player.moveDown(x, y));
		x = 5;
		y = 7;
		assertTrue(player.downRight(x, y));
		x = 8;
		y = 8;
		assertTrue(player.downLeft(x, y));
		x = 9;
		y = 9;
		assertFalse(player.downLeft(x, y));
	}
	
	@Test
	public void testSet(){
		Prison.setEl(3, 4, new Exit());
		assertTrue(prison.victory(3, 4));
		Prison.setEl(3, 4, new Monster());
		assertTrue(prison.findMonster(3, 4));
		Prison.setEl(7, 4, new Wall());
		assertTrue(prison.findWall(7, 4));
		Prison.setEl(5, 6, new Potion());
		assertFalse(Prison.getEl(5, 6) instanceof Wall);
	}
	
	
}
